package com.ovo.dailypayaccount.controller;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Description 切面测试
 * @Author wubin
 * @Date 2019-08-10 16:38
 * @Version 1.0
 **/
@Component
@Aspect
public class AopTest {
    Logger logger = LoggerFactory.getLogger(AopTest.class);
    private final String POINT_CUT = "execution(* com.ovo.dailypayaccount.controller.LoginController.login(..))";

    private String port;
    @Value("${server.port}")
    public void setPort(String port) {
        this.port = port;
    }

    @Pointcut(POINT_CUT)
    public void interceptor(){
    }
    @Before(value = "interceptor()")
    public void printInfo(){
        logger.info("######-Nginx-#####分发请求服务到节点端口号："+port);
    }



}
